fix: preserve attribute-based list operations#344
Open
hjotha wants to merge 2 commits intomendixlabs:mainfrom
Open
fix: preserve attribute-based list operations#344hjotha wants to merge 2 commits intomendixlabs:mainfrom
hjotha wants to merge 2 commits intomendixlabs:mainfrom
Conversation
Symptom: a `find($List, Attribute = expression)` or `filter($List, Attribute = expression)` statement could roundtrip textually but be rebuilt as an expression-based list operation that Studio Pro reports as CE0117. Root cause: the parser and formatter already model Microflows$Find and Microflows$Filter as attribute-based operations, but the builder always produced FindByExpression/FilterByExpression and the writer did not serialize the attribute-based operation variants. Fix: detect equality conditions whose left side is a list member, resolve the member to an attribute or association, build FindByAttributeOperation/FilterByAttributeOperation, and serialize those operations back to the Microflows$Find/Microflows$Filter storage types. Tests: add a builder regression test for `find($Items, Code = $IteratorItem/ExternalCode)` and writer tests for attribute-based find plus association-based filter serialization.
AI Code ReviewCritical IssuesNone found. Moderate IssuesNone found. Minor Issues
What Looks Good
RecommendationApprove the PR. The changes are minimal, well-tested, and directly resolve the reported Studio Pro validation issue (CE0117) by preserving attribute-based list operations when possible. The code follows existing patterns and maintains backward compatibility through the fallback to expression-based operations for complex conditions. No checklist violations were found. Automated review via OpenRouter (Nemotron Super 120B) — workflow source |
36 tasks
Adds an MDL script under mdl-examples/bug-tests/ exercising `find($List, Attribute = expression)` and `filter($List, Attribute = expression)`. After exec, `mx check` reports 0 errors, confirming the rebuild emits Microflows$Find / Microflows$Filter with attribute-operation shape. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
find/filter($List, Attribute = expression)as attribute-based list operations when possibleFindByAttributeOperation/FilterByAttributeOperationtoMicroflows$Find/Microflows$FilterWhy
The parser and formatter already know about attribute-based list operations, but
mxcli execrebuilt them as expression-based operations. That can produce an MPR that is textually stable but fails Studio Pro validation with CE0117 on the list operation activity.Validation
make buildmake lint-gomake testCloses #343.
Related to #332.